<table class="table-form">
    <colgroup>
        <col width="150px"><col>
    </colgroup>
    <tr>
        <th>封面图片：</th>
        <td>
            <input type="hidden" name="img2_txt" value="{$goods.img2}"/>
            <input type="file" name="img2"/>请上传640*640照片
            {if $goods.img2 neq ''}
                <br/>
                <a href="{Service_Attach::getInstance()->getThumbUrl($goods['img2'])}" target="_blank">
                    <img src="{Service_Attach::getInstance()->getThumbUrl($goods['img2'],200,200)}"/>
                </a>
            {/if}
        </td>

    </tr>

    <tr>
        <th>列表图片(可选)：</th>
        {if $goods.img1 neq ""}{$img1_data = explode(",", $goods.img1)}{/if}
        {$img1_sum = count($img1_data)}
        {*{var_dump($img1_data)}*}
        <td>
            {foreach $img1_data as $k => $v}
                <div style="padding-bottom: 20px;" id="sss_{$k}">
            <input type="hidden" name="img1_{$k}_txt" value="{$v}"/>
            <input type="file" name="img1_{$k}"/>请上传640*640照片
            {if $v neq ''}
                <br/>
                <a href="{Service_Attach::getInstance()->getThumbUrl($v)}" target="_blank">
                    <img src="{Service_Attach::getInstance()->getThumbUrl($v,200,200)}"/>
                </a>
            {/if}
                    <button style="color: #1c8ede" type="button" onclick='delImg("sss_{$k}")'>删除</button>
                </div>
            {/foreach}
            {if $img1_sum eq 0}
                <input type="hidden" name="img1_0_txt" value=""/>
                <input type="file" name="img1_0"/>请上传640*640照片
                <input type="hidden" name="img1_1_txt" value=""/>
                <input type="file" name="img1_1"/>请上传640*640照片
                <input type="hidden" name="img1_2_txt" value=""/>
                <input type="file" name="img1_2"/>请上传640*640照片
                <input type="hidden" name="img1_3_txt" value=""/>
                <input type="file" name="img1_3"/>请上传640*640照片
            {/if}
            {if $img1_sum eq 1}
                <input type="hidden" name="img1_1_txt" value=""/>
                <input type="file" name="img1_1"/>请上传640*640照片
                <input type="hidden" name="img1_2_txt" value=""/>
                <input type="file" name="img1_2"/>请上传640*640照片
                <input type="hidden" name="img1_3_txt" value=""/>
                <input type="file" name="img1_3"/>请上传640*640照片
            {/if}
            {if $img1_sum eq 2}
                <input type="hidden" name="img1_2_txt" value=""/>
                <input type="file" name="img1_2"/>请上传640*640照片
                <input type="hidden" name="img1_3_txt" value=""/>
                <input type="file" name="img1_3"/>请上传640*640照片
            {/if}
            {if $img1_sum eq 3}
                <input type="hidden" name="img1_3_txt" value=""/>
                <input type="file" name="img1_3"/>请上传640*640照片
            {/if}
        </td>

    </tr>

    <tr>
        <th>首页推荐图片：</th>
        <td>
            <input type="hidden" name="img3_txt" value="{$goods.img3}"/>
            <input type="file" name="img3"/>请上传640*280照片
            {if $goods.img3 neq ''}
                <br/>
                <a href="{Service_Attach::getInstance()->getThumbUrl($goods['img3'])}" target="_blank">
                    <img src="{Service_Attach::getInstance()->getThumbUrl($goods['img3'],200,87)}"/>
                </a>
            {/if}
        </td>
    </tr>
    <tr>
        <th>排序值：</th>
        <td>
            <input type="text"  name="paixu" value="{$goods.paixu}" class="form-control" />
        </td>
    </tr>
</table>

<script type="text/javascript">
    function delImg(id){
        alert(id);
        $("#" + id).remove();
    }
</script>